﻿<Controls:GlassWindow
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:Controls="clr-namespace:ApplicationHelper.Controls;assembly=ApplicationHelper" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      x:Class="ApplicationScheduler.MainWindow" StateChanged="GlassWindow_StateChanged" Icon="Assets/title.png"
      Title="Application Scheduler" WindowStartupLocation="CenterScreen" Height="618" Width="330" mc:Ignorable="d" ResizeMode="CanMinimize" >
    <Controls:GlassWindow.Resources>
        <DataTemplate x:Key="InsideListTemplate">
            <StackPanel Orientation="Horizontal">
                <Image Source="{Binding ExeIcon}" Width="32" Height="32"/>
                <Rectangle Width="5"/>
                <StackPanel Orientation="Vertical">
                    <TextBlock Text="{Binding Name}" Width="250" TextWrapping="Wrap" FontFamily="Calibri" FontSize="12"/>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Run At →" FontFamily="Calibri" FontSize="16"/>
                        <TextBlock Text="{Binding StartTime}" FontFamily="Calibri" FontSize="16"/>
                    </StackPanel>
                    <Rectangle Height="1" Fill="#FFBDBDBD"/>
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </Controls:GlassWindow.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
        </Grid.RowDefinitions>
    	<Border BorderBrush="Black" BorderThickness="3" CornerRadius="3" Background="#FFBDBDBD">
    		<Grid>
    			<Grid.RowDefinitions>
    				<RowDefinition Height="0.063*"/>
    				<RowDefinition Height="0.082*"/>
    				<RowDefinition Height="0.097*"/>
    				<RowDefinition Height="0.061*"/>
    				<RowDefinition Height="0.538*"/>
    				<RowDefinition Height="0.054*"/>
    				<RowDefinition Height="0.105*"/>
    			</Grid.RowDefinitions>
    			<TextBlock HorizontalAlignment="Left" Margin="5,5,0,-6.998" Opacity="0.2" FontFamily="Calibri" 
                           FontSize="26.667" FontWeight="Bold" Text="Step 1" TextWrapping="Wrap" d:LayoutOverrides="Height"/>
    			<Button x:Name="btnBrowseApplication" Click="BtnBrowseProcessClick"
                        HorizontalAlignment="Right" Margin="0,0,8,2" Width="150" Content="Browse Application" 
                        Height="25" VerticalAlignment="Bottom" ToolTip="Browse for an Application to Add."/>
    			<TextBox x:Name="txtApplicationPath" TextChanged="TxtProcessPathTextChanged" IsReadOnly="True"
                         TextWrapping="Wrap" Margin="8,2,8,0" VerticalScrollBarVisibility="Visible" BorderThickness="1" Grid.Row="1"/>
    			<TextBlock HorizontalAlignment="Left" Margin="5,0,0,23.124" Opacity="0.2" FontFamily="Calibri" 
                           FontSize="26.667" FontWeight="Bold" Text="Step 2" TextWrapping="Wrap" Grid.Row="2" 
                           d:LayoutOverrides="Height"/>
    			<TextBlock HorizontalAlignment="Left" Margin="8,0,0,7.022" Text="Select Time : " 
                           TextWrapping="Wrap" Grid.Row="2" VerticalAlignment="Bottom"/>
    			<ComboBox x:Name="cmbHour" SelectionChanged="TimeSelectionChanged"
                          HorizontalAlignment="Left" Margin="80.71,0,0,3.022" Width="50" d:LayoutOverrides="Width" Grid.Row="2" 
                          VerticalAlignment="Bottom" ToolTip="Select Hour"/>
    			<ComboBox x:Name="cmbMinute" SelectionChanged="TimeSelectionChanged"
                          Margin="134.71,0,123.29,3.022" Width="50" Grid.Row="2" VerticalAlignment="Bottom" ToolTip="Select Minute"/>
    			<ComboBox x:Name="cmbSecond" SelectionChanged="TimeSelectionChanged"
                          Margin="0,0,68.29,3.022" Width="50" HorizontalAlignment="Right" d:LayoutOverrides="Width" Grid.Row="2" 
                          VerticalAlignment="Bottom" ToolTip="Select Second"/>
    			<TextBlock HorizontalAlignment="Left" Margin="5,0,0,2.538" Opacity="0.2" FontFamily="Calibri" FontSize="26.667" 
                           FontWeight="Bold" Text="Step 3" TextWrapping="Wrap" Grid.Row="3" d:LayoutOverrides="Height"/>
    			<Button x:Name="btnAddApplication" Click="btnAddProcess_Click"
                        HorizontalAlignment="Right" Margin="0,0,8,0" Width="150" Content="Add Application" Grid.Row="3" 
                        VerticalAlignment="Center" Height="25" ToolTip="Add Application to your List"/>
    			<ListBox x:Name="lbApplications" ItemTemplate="{StaticResource InsideListTemplate}" 
                         SelectionChanged="LbApplicationsSelectionChanged" LayoutUpdated="LbApplicationsLayoutUpdated"
                         Margin="8,2" Grid.Row="4" ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
                         ScrollViewer.VerticalScrollBarVisibility="Visible"/>
    			<TextBlock HorizontalAlignment="Left" Margin="5,0,0,-1.288" Opacity="0.2" FontFamily="Calibri" 
                           FontSize="26.667" FontWeight="Bold" Text="Step 4" TextWrapping="Wrap" Grid.Row="5" 
                           d:LayoutOverrides="Height"/>
    			<Button x:Name="btnRemoveApplication" Click="BtnRemoveApplicationClick"
                        HorizontalAlignment="Right" Margin="0,0,8,0" Width="150" Content="Remove Application"
                        Grid.Row="5" VerticalAlignment="Center" Height="25" ToolTip="Remove Selected Application from the List"/>
    			<TextBlock HorizontalAlignment="Left" Margin="5,0.004,0,27.712" Opacity="0.2" FontFamily="Calibri" 
                           FontSize="26.667" FontWeight="Bold" Text="Step 5" TextWrapping="Wrap" Grid.Row="6"
                           d:LayoutOverrides="Height"/>
    			<Button x:Name="btnSchedule" Click="BtnScheduleClick" Margin="6,0,0,5" Content="Schedule" Grid.Row="6" 
                        VerticalAlignment="Bottom" Height="25" ToolTip="Schedule and Save" HorizontalAlignment="Left" Width="125"/>
    			<Button x:Name="btnRunNow" Click="BtnRunProcessNowClick"
                        Margin="140,0,53,5" Content="Run Now" Grid.Row="6" 
                        VerticalAlignment="Bottom" Height="25" ToolTip="Run the Application(s) Now"/>
    			<Image HorizontalAlignment="Right" MouseLeftButtonDown="ImageMouseLeftButtonDown"
                       Margin="0,21.32,8,8" Width="32" Height="32" Grid.Row="6" Source="Assets/help.png" Cursor="Hand"/>
    		</Grid>
    	</Border>
    </Grid>
</Controls:GlassWindow>
